package cc.aaa;

/**
 * @author ${崔灿}
 * @date 2022/10/25 17:10
 **/

public class Demo04 {
    public static void main(String[] args) {
        Info<Integer> info1 = new Info<>();
        info1.setVar(15);
        fun(info1);

        Info<Number> info3 = new Info<>();
        info3.setVar(25.5);
        fun(info3);
        Info<String> info2 = new Info<>();
        info2.setVar("hello");

        Info<Object> info4 = new Info<>();
        fun2(info4);
    }
    public static void fun(Info<? extends Number> info){
        info.show();
    }
    public static void fun2(Info<? super String> info){

    }
}
class Info<T>{
    public  T var;
    public void show(){
        System.out.println("var*********"+var);
    }

    public T getVar() {
        return var;
    }

    public void setVar(T var) {
        this.var = var;
    }

    @Override
    public String toString() {
        return "cc.aaa.Info{" +
                "var=" + var +
                '}';
    }
}
